import request from '@/utils/request';

export type LoginPayload = {
  userName: string 
  password: string 
}

export async function login(payload: LoginPayload) {
  console.log('login', payload)
  //const res = await $$.post('/user/login', payload);
  const res = await request('/u/login', {
    data: {
      userName: payload.userName,
      password: payload.password,
    },
    method: 'POST',
  });
  console.log(res.data)
  return res
  //console.log('login res', res)
  //return res;
}